#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
class Solution
{
public:
    int getMinimumTime_1(vector<int> &time, vector<vector<int>> &fruits, int limit)
    {
        int ans = 0;

        for (int i = 0; i < fruits.size(); i++)
        {
            int type = fruits[i][0], num = fruits[i][1];
            ans += time[type] * (ceil(num * 1.0 / limit));
        }
        return ans;
    }

    int getMinimumTime(vector<int> &time, vector<vector<int>> &fruits, int limit)
    {
        int ans = 0;
        for (auto &fruit : fruits)
            ans += (fruit[1] / limit + (fruit[1] % limit != 0)) * time[fruit[0]];
        return ans;
    }
};
int main()
{
    Solution s;
    return 0;
}